<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>财务日报添加</title>
		  <#assign base=request.contextPath  />
		 <link rel="stylesheet" href="${base}/js/layui/css/layui.css?t=1534970980648" media="all">
		 <script type="text/javascript" src="${base}/js/zhang.js"></script>
		 <script src="${base}/js/layui/layui.js" charset="utf-8"></script>
         <script type="text/javascript" src="${base}/js/ztree/jquery-1.4.4.min.js"></script>
         <script src="${base}/js/jquery.min.js"></script>

		<style type="text/css">
		form{
		  padding:20px;
		}
		.layui-btn-radius{
                			border-radius: 5px;
                		}
		</style>
	</head>
	<body>

	<form class="layui-form" action="">
        <div class="layui-form-item">



            <#--<div class="layui-inline">
                <label class="layui-form-label" ><a style="color:red">*</a>&nbsp;日期</label>
                <div class="layui-input-inline">
                    <input name="number" id="date" lay-verify="required"  autocomplete="off" class="layui-input isNull" type="text">
                </div>
            </div>-->
            <#--<div class="layui-inline">
                <label class="layui-form-label" ><a style="color:red">*</a>&nbsp;昨天剩余</label>
                <div class="layui-input-inline">
                    <input name="number" id="yesterdayMoney" lay-verify="required"  autocomplete="off" class="layui-input isNull" type="text">
                </div>
            </div>-->

               <#-- <div class="layui-inline">
                    <label class="layui-form-label"><a style="color:red">*</a>&nbsp;收支类型</label>
                    <div class="layui-input-inline">
                        <select name="city" lay-verify="required" lay-search="" class="isNull" id="income">
                            <option value="">请选择收支类型</option>
                            <option value="支出">支出</option>
                            <option value="收入">收入</option>
                        </select>
                    </div>
                </div>-->

            <#--<div class="layui-inline">
                <label class="layui-form-label" ><a style="color:red">*</a>&nbsp;明细</label>
                <div class="layui-input-inline">
                    <input name="number" id="incomeTotal" lay-verify="required"  autocomplete="off" class="layui-input isNull" type="text">
                </div>
            </div>-->
                <div class="layui-inline">
                    <label class="layui-form-label" >支出类型</label>
                    <div class="layui-input-inline">
                        <input name="number" id="incomeType"   autocomplete="off" class="layui-input" type="text">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label" >支出金额</label>
                    <div class="layui-input-inline">
                        <input name="number" id="expenditureMoney"   autocomplete="off" class="layui-input" type="text">
                    </div>
                </div>

                <div class="layui-inline">
                    <label class="layui-form-label" >收入类型</label>
                    <div class="layui-input-inline">
                        <input name="number" id="typeExpenditure"   autocomplete="off" class="layui-input" type="text">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label" >收入金额</label>
                    <div class="layui-input-inline">
                        <input name="number" id="incomeMoney"   autocomplete="off" class="layui-input" type="text">
                    </div>
                </div>

                <div class="layui-inline">
                    <label class="layui-form-label" ><a style="color:red">*</a>&nbsp;录入人</label>
                    <div class="layui-input-inline">
                        <input name="number" id="person" lay-verify="required"  autocomplete="off" class="layui-input isNull" type="text">
                    </div>
                </div>
            <#--<div class="layui-inline">
                <label class="layui-form-label" ><a style="color:red">*</a>&nbsp;收入银行存款</label>
                <div class="layui-input-inline">
                    <input name="number" id="cashDeposit" lay-verify="required"  autocomplete="off" class="layui-input isNull" type="text">
                </div>
            </div>-->
           <#-- <div class="layui-inline">
                <label class="layui-form-label" ><a style="color:red">*</a>&nbsp;支出总计</label>
                <div class="layui-input-inline">
                    <input name="number" id="totalExpenditure" lay-verify="required"  autocomplete="off" class="layui-input isNull" type="text">
                </div>
            </div>-->
           <#-- <div class="layui-inline">
                <label class="layui-form-label" ><a style="color:red">*</a>&nbsp;支付类型</label>
                <div class="layui-input-inline">
                    <input name="number" id="paymentType" lay-verify="required"  autocomplete="off" class="layui-input isNull" type="text">
                </div>
            </div>-->
           <#-- <div class="layui-inline">
                <label class="layui-form-label" ><a style="color:red">*</a>&nbsp;支出银行存款</label>
                <div class="layui-input-inline">
                    <input name="number" id="expenditureDeposit" lay-verify="required"  autocomplete="off" class="layui-input isNull" type="text">
                </div>
            </div>-->
            <#--<div class="layui-inline">-->
                <#--<label class="layui-form-label" ><a style="color:red">*</a>&nbsp;余额</label>-->
                <#--<div class="layui-input-inline">-->
                    <#--<input name="number" id="balance" lay-verify="required" autocomplete="off" class="layui-input isNull" type="text">-->
                <#--</div>-->
            <#--</div>-->
                <div class="layui-inline">
                    <label class="layui-form-label" ><a style="color:red">*</a>&nbsp;负责人签字</label>
                    <div class="layui-input-inline">
                        <input name="number" id="responsible" lay-verify="required"   autocomplete="off" class="layui-input isNull" type="text">
                    </div>
                </div>



            <div class="layui-inline">
                <label class="layui-form-label" >备注</label>
                <div class="layui-input-inline">
                    <input name="number" id="remarks"   autocomplete="off" class="layui-input" type="text">
                </div>
            </div>



            <div class="layui-form-item"style="margin-left:320px">
                <div class="layui-input-block">
                    <button class="layui-btn layui-btn-radius" lay-submit lay-filter="formDemo" type="button" onclick="insert()" style="background-color: #0092EF;">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary layui-btn-radius">重置</button>
                </div>
            </div>
        </div>
    </form>
<script>
layui.use(['form', 'layedit', 'laydate','layer'], function(){
  var form = layui.form
  ,layer = layui.layer
  ,layedit = layui.layedit
  ,laydate = layui.laydate;
   //日期
  laydate.render({
    elem: '#date'
  });


  //监听提交
 // form.on('submit(formDemo)', function(data){
 //   layer.msg(JSON.stringify(data.field));
 //   return false;
 // });

});

    function insert(){

        if(!isNull()){
            return;
        }


        var jsonData = {};
        //收支类型  income
        jsonData.income = $("#income").val();
        //收入现金  incomeMoney
        jsonData.incomeMoney = $("#incomeMoney").val();
        //收入类型  typeExpenditure
        jsonData.typeExpenditure = $("#typeExpenditure").val();
        //支出金额  expenditureMoney
        jsonData.expenditureMoney = $("#expenditureMoney").val();
        //支出类型 incomeType
        jsonData.incomeType = $("#incomeType").val();
        //录入人 person
        jsonData.person = $("#person").val();
        //负责人签字 responsible
        jsonData.responsible = $("#responsible").val();
//备注
        jsonData.remarks = $("#remarks").val();


        //日期
        //jsonData.date = $("#date").val();
        //费用名称
        //jsonData.costName = $("#costName").val();
        //收入现金
        //jsonData.cashMoney = $("#cashMoney").val();
        //收入银行存款
        //jsonData.cashDeposit = $("#cashDeposit").val();
        //支出现金
        //jsonData.expenditureMoney = $("#expenditureMoney").val();
        //支出银行存款
        //jsonData.expenditureDeposit = $("#expenditureDeposit").val();
        //余额
        //jsonData.balance = $("#balance").val();
        //昨天剩余
        //jsonData.yesterdayMoney = $("#yesterdayMoney").val();
        //支付类型
        //jsonData.paymentType = $("#paymentType").val();
        //收入总计
        //jsonData.incomeTotal = $("#incomeTotal").val();
        //支出总计
        //jsonData.totalExpenditure = $("#totalExpenditure").val();




        $.ajax({
            type:"POST",
            url:"${base}/financialDaily/insertDayMoney1",
            data:{"param":JSON.stringify(jsonData)},
            success:function(data){
            alert("成功")

                setTimeout(function(){
                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                    parent.layer.close(index); //再执行关闭
                },800)
                //收支类型  income
                jsonData.income = $("#income").val("");
                //收入现金  incomeMoney
                jsonData.incomeMoney = $("#incomeMoney").val("");
                //收入类型  typeExpenditure
                jsonData.typeExpenditure = $("#typeExpenditure").val("");
                //支出金额  expenditureMoney
                jsonData.expenditureMoney = $("#expenditureMoney").val("");
                //支出类型 incomeType
                jsonData.incomeType = $("#incomeType").val("");
                //录入人 person
                jsonData.person = $("#person").val("");
                //负责人签字 responsible
                jsonData.responsible = $("#responsible").val("");
                //备注
                jsonData.remarks = $("#remarks").val("");


                //日期
                //jsonData.date = $("date").val("");
                //费用名称
                //jsonData.costName = $("costName").val("");
                //收入现金
                //jsonData.cashMoney = $("cashMoney").val("");
                //收入银行存款
                //jsonData.cashDeposit = $("cashDeposit").val("");
                //支出现金
                //jsonData.expenditureMoney = $("expenditureMoney").val("");
                //支出银行存款
                //jsonData.expenditureDeposit = $("expenditureDeposit").val("");
                //余额
                //jsonData.balance = $("balance").val("");
                //备注
                //jsonData.remarks = $("remarks").val("");
                //支付类型
                //jsonData.paymentType = $("#paymentType").val("");
                //收入总计
                //jsonData.incomeTotal = $("#incomeTotal").val("");
                //支出总计
                //jsonData.totalExpenditure = $("#totalExpenditure").val("");
                //昨天剩余
                //jsonData.yesterdayMoney = $("#yesterdayMoney").val("");


                var table = parent.layui.table;
                //表刷新方法
                table.reload('testReload', {
                    url: '${base}/financialDaily/selectdaymoney'
                    ,where: {} //设定异步数据接口的额外参数
                    //,height: 300
                });
            }
        });



    }






</script>
	</body>
</html>
